package RTL.Task3;

//用户消费类封装
public class UserConsumption {
    // 私有化特征
    //时长
    private int talkTime;
    //流量
    private double netFlow;
    //月费
    private double rate;  
    //短信
    private int msgCount;

    // constructor
    public UserConsumption() {
    }

    public UserConsumption(int talkTime, double netFlow, double rate, int msgCount ) {
        setTalkTime(talkTime);
        setNetFlow(netFlow);
        setRate(rate);
        setMsgCount(msgCount );
    }

    // 共有set和get
    public int getTalkTime() {
        return talkTime;
    }

    public void setTalkTime(int talkTime) {
        this.talkTime = talkTime;
    }

    public double getNetFlow() {
        return netFlow;
    }

    public void setNetFlow(double netFlow) {
        this.netFlow = netFlow;
    }

    public double getRate() {
        return rate;
    }

    public void setRate(double rate) {
        this.rate = rate;
    }

    public int getMsgCount() {
        return msgCount;
    }

    public void setMsgCount(int msgCount) {
        this.msgCount = msgCount;
    }


    // 打印消费消息
    public void show() {
        System.out.println("已用通话时间: " + getTalkTime() + "分钟，已用流量: " + getNetFlow() + "MB，已发短信" + getMsgCount() + "本月消费: " + getRate());

    }
}
